import request from '@/utils/request'

// 查询医生信息列表
export function listDoctors(query) {
  return request({
    url: '/system/doctors/list',
    method: 'get',
    params: query
  })
}

// 查询医生信息详细
export function getDoctors(id) {
  return request({
    url: '/system/doctors/' + id,
    method: 'get'
  })
}

// 新增医生信息
export function addDoctors(data) {
  return request({
    url: '/system/doctors',
    method: 'post',
    data: data
  })
}

// 修改医生信息
export function updateDoctors(data) {
  return request({
    url: '/system/doctors',
    method: 'put',
    data: data
  })
}

// 删除医生信息
export function delDoctors(id) {
  return request({
    url: '/system/doctors/' + id,
    method: 'delete'
  })
}

//下载文件
export function download(avatar) {
  return request({
    url: '/common/download/resource',
    method: 'get',
    params: { resource:avatar }
  })
}

//根据科室名称查询医生姓名
export function getDoctorsNameByDepartment(department){
    return request({
      url: `/system/doctors/getDoctorsNameByDepartment/${department}`,
      method: 'get'
    })
}

